
<template>
	<div class="form-container">
		<div class="avue-form__group">
			<div v-if="props.dataJson.name == 'building-img'">
				<el-form ref="dataFormRef" :model="form"  label-width="auto">
					<el-row>
						<el-col :span="24" class="mb20">
							<el-form-item label="建筑图片:" prop="avatarUrl">
								<upload-img v-model:image-url="form.avatarUrl" />
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
			<div v-if="props.dataJson.name == 'project-view'">
				<el-form ref="dataFormRef" :model="form"  label-width="auto">
					<el-row>
						<el-col :span="24" class="mb20">
							<el-form-item label="建筑图片1:" prop="avatarUrl">
								<upload-img v-model:image-url="form.avatarUrl" />
							</el-form-item>
						</el-col>
					</el-row>
				</el-form>
			</div>
		</div>
	</div>
</template>

<script setup lang="ts" name="formLabel">



const props = defineProps({
  dataJson: {
    type: Object,
    default: null,
  },
});

// 提交表单数据
const form = reactive({
  id: '',
  name: '',
  avatarUrl: '',
});



const flag = ref(false)

onMounted(() => {
	console.log(props.dataJson)
})


// 暴露变量 只有暴漏出来的变量 父组件才能使用
defineExpose({
  form
});
</script>

<style scoped lang="scss">
.form-container {
	padding: 0 20px;
	:deep(.el-form) {
		.el-form-item {
			.el-form-item__label-wrap  {
				.el-form-item__label {
					width: 90px!important;
				}
			}
		}
	}
	
}
</style>
